package com.king.base;

import java.util.Comparator;

import com.google.common.collect.ComparisonChain;
import com.google.common.collect.Ordering;

public class StudentComparator implements Comparator<Student> {

	@Override
	public int compare(Student s1, Student s2) {
		return ComparisonChain.start()
				.compare(s1.name, s2.name)
				.compare(s1.age, s2.age)
				.compare(s1.score, s2.score, Ordering.natural().nullsLast())
				.result();
	}
}